// 把字符串保存到一个变量中，变量有代码提示
const TokenHmtt = 'Token_Hmtt'
const UserInfo = 'UserInfo'
// 设置token到本地存储
export const setToken = (tokenStr) => {
    localStorage.setItem(TokenHmtt, tokenStr)
}
//获取本地存储到token
// 获取本地存储 - 获取后记得返回，注意保持数据统一性
export const getToken = () => {
    return localStorage.getItem(TokenHmtt) || ''
}
//在本地存储删除token
export const removeToken = () => {
    localStorage.removeItem(TokenHmtt)
}
//设置用户信息到本地存储
export const setUserInfo = (userStr) => {
    localStorage.setItem(UserInfo, JSON.stringify(userStr))
}
//获取到本地的用户信息
export const getUserInfo = () => {
    return JSON.parse(localStorage.getItem(UserInfo)) || {}
}
//在本地存储删除用户信息
export const remomveUserInfo = () => {
    localStorage.removeItem(UserInfo)
}